<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/amazeui.min.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/admin.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/app.css">
</head>
<body>
	<div class="tpl-content-page-title">权限管理</div>
	<ol class="am-breadcrumb">
		<li><a href="#" class="am-icon-home">首页</a></li>
		<li class="am-active">权限管理</li>
	</ol>
	<div class="row">
			<div class="am-u-md-6">
				<div class="tpl-portlet">
					<div class="tpl-portlet-title">
						<div class="tpl-caption font-green">
							<i class="am-icon-user-secret"></i> <span> 角色管理</span>
						</div>
						<div class="am-btn-toolbar" style="float: right">
							<div class="am-btn-group am-btn-group-xs">
								<a class="am-btn am-btn-default am-btn-success" href="${pageContext.request.contextPath}/admin/roleForm.jsp">
									<span class="am-icon-plus"></span> 新增
								</a>
							</div>
						</div>
					</div>
					<div>
						<table class="am-table tpl-table">
							<thead>
								<tr class="tpl-table-uppercase">
									<th>角色ID</th>
									<th>角色名称</th>
									<th>角色内容</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
							<c:forEach items="${roleList}" var="role">
								<tr>
									<td>${role.id }</td>
									<td>${role.role_name }</td>
									<td>${role.role_content }</td>
									<td>
										<div class="am-btn-toolbar">
											<div class="am-btn-group am-btn-group-xs">
												<a href="${pageContext.request.contextPath}/admin/deleteRole.do?id=${role.id }" class="am-btn am-btn-default am-btn-xs am-text-secondary">
													<span class="am-icon-trash-o"></span> 删除
												</a>
											</div>
										</div>
									</td>
								</tr>
							</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!--一行6格结束 -->
			<div class="am-u-md-6">
				<div class="tpl-portlet">
					<div class="tpl-portlet-title">
						<div class="tpl-caption font-green ">
							<i class="am-icon-lock"></i> <span> 权限管理</span>
						</div>
						<div class="am-btn-toolbar">
							<div class="am-btn-group am-btn-group-xs" style="float: right">
								<a class="am-btn am-btn-default am-btn-success"  href="${pageContext.request.contextPath}/admin/permissionForm.jsp">
									<span class="am-icon-plus"></span> 新增
								</a>
							</div>
						</div>
					</div>
					<div>
						<table class="am-table tpl-table">
							<thead>
								<tr class="tpl-table-uppercase">
									<th>权限ID</th>
									<th>权限名称</th>
									<th>权限内容</th>
									<th>所属角色</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
							<c:forEach items="${permissionList}" var="permission">
								<tr>
									<td>${permission.id }</td>
									<td>${permission.permission_name }</td>
									<td>${permission.permission_content }</td>
									<td>${permission.role_name }</td>
									<td>
										<div class="am-btn-toolbar">
											<div class="am-btn-group am-btn-group-xs">
												<a href="${pageContext.request.contextPath}/admin/deletePermission.do?id=${permission.id }" class="am-btn am-btn-default am-btn-xs am-text-secondary">
													<span class="am-icon-trash-o"></span> 删除
												</a>
											</div>
										</div>
									</td>
								</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
</body>
</html>